Skip to content

MCP server and packaging (#66, Part 9) - #74

Merged
n4ff4h merged 3 commits into
devfrom
fix/66-part9-mcp-packaging
Nov 18, 2026
Merged

n4ff4h merged 3 commits into
devfrom
fix/66-part9-mcp-packaging

Conversation

@n4ff4h

@n4ff4h n4ff4h commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes Part 9 of #66 (MCP server and packaging): better docs search, a fallback when project docs don't load, and no test files in the npm tarball.

Item Change
9.1 searchDocs matches the page path and the split words of CamelCase titles. A whole title or file-name word scores 30 (part of one 20), a page whose title words all appear in the query gets +50, and an exact match on the title or file name gets +100. date-picker now returns date-and-time/date-picker first (it was date-time-picker), and "Button props" puts Button above SubmitButton. The onu_get_doc closest-match hint uses the same ranking.
9.2 loadDocs checks the project docs before using them: the folder exists, index.json parses and has sections, and every listed page's .md is there. If any check fails it writes a warning with the reason to stderr (console.error, never stdout) and loads the bundled docs. An empty ONU_DOCS_DIR counts as unset. Tests can pass a new bundled option to point at another bundled folder. README and docs/guides/ai-assistants.md mention the fallback.
9.3 packages/onu/package.json files excludes !src/**/*.test.*. The new scripts/check-pack.mjs runs pnpm pack --dry-run --json (the same file list pnpm publish uses) for each published package and fails if a test file would ship. It runs in CI after the Boost check and is listed in AGENTS.md.

Skipped ([P] / device check)

  • None. Part 9 has no [P] items.

Could not reproduce

  • None.

Behaviour/API changes

  • loadDocs takes a new bundled?: string option. A project docs folder that fails to load no longer crashes the server: it falls back with a stderr warning.
  • Search scores changed (see 9.1), so the order of results differs for some queries.

Verification

  • Failing tests first: 9.1 (date-picker gave date-time-picker; Button props gave submit-button), 9.2 (ENOENT / SyntaxError thrown, source: "project" with a missing page, ./index.json read for ONU_DOCS_DIR=""), 9.3 (check-pack.mjs listed @javaabu/onu: src/styles/theme.test.ts).
  • Built binary with ONU_DOCS_DIR=/nope: 0 bytes on stdout, a warning and then "serving ... (194 pages, bundled)" on stderr.
  • pnpm lint, pnpm format:check, pnpm typecheck: pass
  • pnpm --filter @javaabu/onu exec vitest run --maxWorkers=3: 197 files, 2858 passed, 1 skipped
  • pnpm --filter @javaabu/onu-mcp test: 24 passed
  • node scripts/check-docs.mjs: Docs OK
  • pnpm build && pnpm --filter @javaabu/onu size: pass, no budget changes
  • node scripts/check-pack.mjs, node scripts/boost.mjs --check: pass

🤖 Generated with Claude Code

agent and others added 3 commits November 18, 2026 05:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 9.2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@n4ff4h
n4ff4h merged commit ee2fd38 into dev Nov 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant